<script setup>
import { computed } from 'vue'
import { useRoute } from 'vue-router'

const route = useRoute()

// 不需要显示备案号的路由路径
const hiddenFooterRoutes = ['/role-detail-word', '/video']

// 计算是否应该显示footer
const shouldShowFooter = computed(() => {
  const currentPath = route.path
  return !hiddenFooterRoutes.some(path => currentPath.startsWith(path))
})
</script>

<template>
  <div class="app-container">
    <main class="content">
      <router-view />
    </main>
    <footer class="footer" v-if="shouldShowFooter">
      <a href="https://beian.miit.gov.cn/" target="_blank">沪ICP备2025142695号</a>
    </footer>
  </div>
</template>

<style lang="less" scoped>
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body,
#app {
  height: 100%;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.app-container {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.content {
  flex: 1;
  min-height: 0;
  padding-bottom: 0;
}

.footer {
  text-align: center;
  font-size: 12px;
  color: #666;
  padding: 20px 0;
  background: #fdf8f8;
  border-top: 1px solid #e0e0e0;
  flex-shrink: 0;
  position: relative;
  left: 0;
  right: 0;
  a {
    color: black;
    text-decoration: none;
  }
}
</style>
